package com.my.java.concurrent.blocking_quere.array_blocking_queue;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;


public class BlockingQueueExample {  
        
        public static void main(String[] args) throws Exception {  
      
            BlockingQueue queue = new ArrayBlockingQueue(1);  
      
            Producer producer = new Producer(queue);  
            Consumer consumer = new Consumer(queue);  
      
            new Thread(producer).start();  
            new Thread(consumer).start();  
      
            Thread.sleep(4000);  
        }  
    }  